sse2-float: use same TRC for "leftover" samples
authorEll <ell_se@yahoo.com>
Sat, 13 Jan 2018 09:02:24 +0000 (04:02 -0500)
committerEll <ell_se@yahoo.com>
Sat, 13 Jan 2018 09:09:10 +0000 (04:09 -0500)
The SSE2 versions of the gamma <-> linear TRC functions can produce
slightly different results than the scalar ones.  Consequently,
last commit didn't resolve all discrepancies between the main and
leftover samples (and didn't address the gamma -> linear
direction).

Use the same SSE2 TRC functions for converting the leftover
samples, rather than the scalar functions, to fix that.

extensions/sse2-float.c

index bb9f72e191a43e4c11cf4b59040a29f5e12dc1ba..800ac971e2b43aaf24a3737c64ca065e533fac6c 100644 (file)
@@ -432,7 +432,8 @@ conv_yaF_linear_yaF_gamma (const Babl *conversion,const float *src, float *dst,
 
   while (samples--)
     {
-      *dst++ = babl_linear_to_gamma_2_2f (*src++);
+      float y = *src++;
+      *dst++ = linear_to_gamma_2_2_sse2 (splat4f (y))[0];
       *dst++ = *src++;
     }
 }
@@ -466,7 +467,8 @@ conv_yaF_gamma_yaF_linear (const Babl *conversion,const float *src, float *dst,
 
   while (samples--)
     {
-      *dst++ = babl_gamma_2_2_to_linear (*src++);
+      float y = *src++;
+      *dst++ = gamma_2_2_to_linear_sse2 (splat4f (y))[0];
       *dst++ = *src++;
     }
 }
@@ -503,7 +505,8 @@ conv_yF_linear_yF_gamma (const Babl *conversion,const float *src, float *dst, lo
 
   while (samples--)
     {
-      *dst++ = babl_linear_to_gamma_2_2f (*src++);
+      float y = *src++;
+      *dst++ = linear_to_gamma_2_2_sse2 (splat4f (y))[0];
     }
 }
 
@@ -539,7 +542,8 @@ conv_yF_gamma_yF_linear (const Babl *conversion,const float *src, float *dst, lo
 
   while (samples--)
     {
-      *dst++ = babl_gamma_2_2_to_linear (*src++);
+      float y = *src++;
+      *dst++ = gamma_2_2_to_linear_sse2 (splat4f (y))[0];
     }
 }